<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>仓管理</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/own.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<script type="text/javascript" src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<style type="text/css">
			.mui-content-padded div{
				/*background:#f07a0c;
				color:#ffffff;*/
				font-size:0.6rem;
				padding:0.2rem 1rem;
				border-radius:0.2rem ;
				border:solid 0.5px #D6D6D6;
				font-weight: 600;
			}
			.zt_c{
				height:0.8rem;
				display:inline-block;
				background:#007aff;
				color:#ffffff;
				font-size:0.5rem;
				padding:0 0.2rem;
				border-radius:0.2rem;
				margin-left:0.3rem;
				line-height:0.9rem;
			}
			.mui-table-view-cell.mui-active {
				    background-color: #fff;
				}
			
		</style>
	</head>

	<body style="background: #FFFFFF;font-size: 0.8rem;">
		<header class="mui-bar own-mui-bar-nav own-main-background-color ">
			<h1 class="mui-title">单元工程</h1>
			<a  class="mui-icon mui-icon-plusempty mui-icon-right-nav mui-pull-right"  style="font-size: 1.6rem;line-height: 1rem;margin-right: 0.2rem;display: none;" id="add"></a>
		</header>
		<div class="mui-content" style="background: #FFFFFF;">
			
				<ul class="mui-table-view" id="ul_list">
					
				</ul>
			 
		</div>
		
	</body>
	<script>
	 
	    
		mui.init();
		
		var indexview = null;
		
		var stare=null;
        
		mui.plusReady(function() {
			
			
			indexview = plus.webview.currentWebview();

			stare = indexview.data;
			
			if(stare == 'C'){
				$('#add').show();
				
				document.getElementById('add').addEventListener('tap',function () {
                  gotoSumPage('unit_info.html?'+ localStorage.getItem('node'));
                })
			}
			
            ajaxinfo();
           
		});
		
		function ajaxinfo(){
			 mpms_ajax({node:localStorage.getItem('node')},'getZoneList',function(data){
          	 	if(data.list.length>0){
          	 		$('#ul_list').empty();
          	 			for(let i=0;i<data.list.length;i++) {
          	 			   setItems(data.list[i],i);
					    }
          	 	}
          	 })
		}
		
		function setItems(info,i){
				var htmls = '';
				if(stare == 'A'){
					htmls += '<li class="mui-table-view-cell" onclick="tzcanglist(\'' + info.uid + '\')">';
				}else{
					htmls += '<li class="mui-table-view-cell">';
				}
				
				htmls += '<span style="line-height: 0.8rem;">'+info.name+'</span>';
				htmls += '<div class="zs_content_bg mui-clearfix" style="font-size: 0.6rem;margin-top: 0.3rem;">';
				htmls += '<div class="mui-pull-left">工程编号：<span >'+info.uid+'</span></div>';
				htmls += '<div class="mui-pull-right mui-ellipsis" style = "width: 6rem;">单元厚度：<span >'+info.step+'</span></div></div>';
				if(stare == 'A'){
					htmls += '<div class="mui-pull-right"><a class="mui-navigate-right"></a></div>';
				}
				htmls +='</li>'
				$('#ul_list').append(htmls);
				
				
			}
		
       function tzcanglist(uid){
       	  getPagetoken();
       	  gotoSumPage('main_wamange.html?'+uid )
       }
		
	</script>

</html>